<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <html><head>
        <link rel="stylesheet" type="text/css" href="apidocs.css"/>
        <title>API docs for &ldquo;sympy.geometry.polygon.Polygon&rdquo;</title>
        </head>
        <body><h1 class="class">Class s.g.p.Polygon(<a href="sympy.geometry.entity.GeometryEntity.html">GeometryEntity</a>):</h1><span id="part">Part of <a href="sympy.geometry.polygon.html">sympy.geometry.polygon</a></span><p>known subclasses: <a href="sympy.geometry.polygon.RegularPolygon.html">sympy.geometry.polygon.RegularPolygon</a>, <a href="sympy.geometry.polygon.Triangle.html">sympy.geometry.polygon.Triangle</a></p><div class="toplevel"><div><p>A simple polygon in space. Can be constructed from a sequence or list of
points.</p>
<h1 class="heading">Notes:</h1>
  <ul>
    <li>
      Polygons are treated as closed paths rather than 2D areas so some 
      calculations can be be negative or positive (e.g., area) based on the
      orientation of the points.
    </li>
  </ul>
</div></div><table class="children"><tr class="function"><td>Function</td><td><a href="#sympy.geometry.polygon.Polygon.__new__">__new__</a></td><td><span class="undocumented">Undocumented</span></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.geometry.polygon.Polygon.area">area</a></td><td><div><p>Returns the area of the polygon.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.geometry.polygon.Polygon.angles">angles</a></td><td><div><p>Returns a dictionary of {point: angle} entries containing the</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.geometry.polygon.Polygon.perimeter">perimeter</a></td><td><div><p>Returns the perimeter of the polygon.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.geometry.polygon.Polygon.vertices">vertices</a></td><td><div><p>The vertices that define the polygon.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.geometry.polygon.Polygon.centroid">centroid</a></td><td><div><p>The centroid of the polygon.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.geometry.polygon.Polygon.sides">sides</a></td><td><div><p>A list of the segments that form the sides fo the polygon.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.geometry.polygon.Polygon.is_convex">is_convex</a></td><td><div><p>Returns True if this polygon is convex, False otherwise.</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.geometry.polygon.Polygon.intersection">intersection</a></td><td><div><p>Returns a list of all of the intersections of this entity and 
another</p>
</div></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.geometry.polygon.Polygon.__eq__">__eq__</a></td><td><span class="undocumented">Undocumented</span></td></tr><tr class="function"><td>Function</td><td><a href="#sympy.geometry.polygon.Polygon.__contains__">__contains__</a></td><td><span class="undocumented">Undocumented</span></td></tr></table>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.polygon.Polygon.__new__">__new__(cls, *args, **kwargs):</a></div>
            <div class="functionBody"><div class="undocumented">Undocumented</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.polygon.Polygon.area">area(self):</a></div>
            <div class="functionBody"><div><p>Returns the area of the polygon.</p>
<h1 class="heading">Notes:</h1>
  <ul>
    <li>
      The area calculation can be positive or negative based on the 
      orientation of the points.
    </li>
  </ul>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.polygon.Polygon.angles">angles(self):</a></div>
            <div class="functionBody"><pre>Returns a dictionary of {point: angle} entries containing the
measure of all the internal angles of this polygon formed at
each vertex.

Examples:
======
    >>> from sympy.geometry import *
    >>> p1,p2,p3,p4 = map(Point, [(0,0), (1,0), (5,1), (0,1)])
    >>> poly = Polygon(p1, p2, p3, p4)
    >>> poly.angles[p1]
    (1/2)*pi
    >>> poly.angles[p2]
    acos(-4/17*17**(1/2))</pre></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.polygon.Polygon.perimeter">perimeter(self):</a></div>
            <div class="functionBody"><div><p>Returns the perimeter of the polygon.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.polygon.Polygon.vertices">vertices(self):</a></div>
            <div class="functionBody"><div><p>The vertices that define the polygon.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.polygon.Polygon.centroid">centroid(self):</a></div>
            <div class="functionBody"><div><p>The centroid of the polygon.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.polygon.Polygon.sides">sides(self):</a></div>
            <div class="functionBody"><div><p>A list of the segments that form the sides fo the polygon.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.polygon.Polygon.is_convex">is_convex(self):</a></div>
            <div class="functionBody"><div><p>Returns True if this polygon is convex, False otherwise.</p>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.polygon.Polygon.intersection">intersection(self, o):</a></div>
            <div class="functionBody"><div><p>Returns a list of all of the intersections of this entity and another 
entity.</p>
<h1 class="heading">Notes:</h1>
  <ul>
    <li>
      This method is not intended to be used directly but rather through 
      the intersection() method found in util.py.
    </li>
    <li>
      An entity is not required to implement this method.
    </li>
    <li>
      If two different types of entities can intersect, it is only required
      that one of them be able to determine this.
    </li>
  </ul>
</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.polygon.Polygon.__eq__">__eq__(self, o):</a></div>
            <div class="functionBody"><div class="undocumented">Undocumented</div></div>
            </div>
            <div class="function">
            <div class="functionHeader">def <a name="sympy.geometry.polygon.Polygon.__contains__">__contains__(self, o):</a></div>
            <div class="functionBody"><div class="undocumented">Undocumented</div></div>
            </div></body>
        